/* 流浪动物之家 - 全局样式优化 */

/* 全局变量定义 */
:root {
  --primary-color: #04a07b;
  --primary-hover: #038066;
  --text-color: #333;
  --text-muted: #666;
  --border-color: #e0e0e0;
  --shadow-light: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-medium: 0 4px 15px rgba(0, 0, 0, 0.15);
  --shadow-heavy: 0 6px 25px rgba(4, 160, 123, 0.3);
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
  --border-radius: 8px;
  --border-radius-large: 12px;
}

/* 全局滚动条优化 */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 4px;
  transition: background var(--transition-normal);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-hover);
}

/* 全局焦点样式优化 */
*:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* 全局按钮基础样式 */
.btn {
  border-radius: var(--border-radius);
  font-weight: 600;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-light);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
}

/* 全局链接样式优化 */
a {
  transition: all var(--transition-normal);
}

a:hover {
  text-decoration: none;
}

/* 顶部欢迎条样式 */
.top_welcome {
  background: linear-gradient(90deg, var(--primary-color) 0%, #06c195 100%);
  color: white;
  font-size: 14px;
  padding: 10px 0;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1020;
  display: none; /* 默认隐藏在小屏幕 */
}

.welcome_text {
  font-weight: 500;
  text-align: center;
  display: block;
}

/* 主导航栏样式 */
.main-navbar {
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(15px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: var(--shadow-light);
  transition: all var(--transition-normal);
  z-index: 1050;
  top: 0;
  padding: 8px 0;
}

.main-navbar .container {
  max-width: 1200px;
}

/* Logo样式 */
.logo {
  max-height: 45px;
  width: auto;
  transition: all var(--transition-normal);
}

.logo:hover {
  transform: scale(1.05);
}

.text-logo {
  color: var(--primary-color);
  font-weight: bold;
  font-size: 20px;
}

/* 导航链接基础样式 */
.navbar-nav .nav-link {
  color: var(--text-color);
  font-size: 15px;
  font-weight: 500;
  padding: 15px 18px !important;
  position: relative;
  transition: all var(--transition-normal);
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color: var(--primary-color);
}

/* 导航下划线效果 */
.navbar-nav .nav-link::after {
  content: "";
  position: absolute;
  bottom: 8px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--primary-color);
  transition: all var(--transition-normal);
  transform: translateX(-50%);
}

.navbar-nav .nav-link:hover::after,
.navbar-nav .nav-link.active::after {
  width: 50%;
}

/* 大屏幕样式 */
@media screen and (min-width: 769px) {
  .top_welcome {
    display: block;
  }

  .main-navbar {
    top: 44px; /* 为顶部欢迎条留出空间 */
    z-index: 1050; /* 确保导航栏在欢迎条之上 */
  }

  .navbar-nav .nav-link {
    padding: 20px 22px !important;
  }

  .navbar-nav .nav-link::after {
    bottom: 12px;
  }

  .logo {
    max-height: 50px;
  }
}

/* 轮播图样式 */
.hero-carousel {
  margin-top: 0;
  position: relative;
  z-index: 1;
}

.carousel-indicators button {
  width: 62px;
  height: 1px;
  border-radius: none;
}

.carousel-indicators button:hover,
.carousel-indicators button.active {
  background: #04a07b;
  border: 1px solid #04a07b;
}

/* 流程卡片样式 */
.process_col {
  text-align: center;
  padding: 20px;
}

.process_col img {
  width: 80px;
  height: 80px;
  margin-bottom: 20px;
}

.process_col h4 {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 15px;
  color: #333;
}

.process_col p {
  color: #666;
  line-height: 1.6;
  font-size: 14px;
}

/* 产品图片样式优化 */
.product_img {
  text-align: center;
  margin-bottom: 30px;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-light);
  transition: all var(--transition-normal);
}

.product_img:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-medium);
}

.product_img img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: all var(--transition-slow);
}

.product_img:hover img {
  transform: scale(1.1);
}

.product_title {
  padding: 15px;
  background: white;
}

.product_title a {
  color: var(--text-color);
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  transition: all var(--transition-normal);
  position: relative;
}

.product_title a:hover {
  color: var(--primary-color);
}

.product_title a::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-color);
  transition: width var(--transition-normal);
}

.product_title a:hover::after {
  width: 100%;
}

/* 新闻图片样式优化 */
.news_img {
  margin-bottom: 30px;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-light);
  transition: all var(--transition-normal);
}

.news_img:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-medium);
}

.news_img img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  transition: all var(--transition-slow);
}

.news_img:hover img {
  transform: scale(1.05);
}

.news_title {
  padding: 15px;
  background: white;
}

.news_title a {
  color: var(--text-color);
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  display: block;
  margin: 0 0 10px 0;
  transition: all var(--transition-normal);
  position: relative;
}

.news_title a:hover {
  color: var(--primary-color);
}

.news_title a::after {
  content: "";
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-color);
  transition: width var(--transition-normal);
}

.news_title a:hover::after {
  width: 100%;
}

.news_desc {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
  padding: 0 15px 15px;
}

/* 选项卡样式优化 */
.tabs_btn .nav-tabs {
  border: none;
  justify-content: center;
  margin-bottom: 30px;
}

.tabs_btn .nav-tabs .nav-link {
  background: white;
  border: 2px solid var(--primary-color);
  border-radius: 25px;
  color: var(--primary-color);
  font-weight: 600;
  padding: 12px 30px;
  margin: 0 8px;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.tabs_btn .nav-tabs .nav-link::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--primary-color);
  transition: left var(--transition-normal);
  z-index: -1;
}

.tabs_btn .nav-tabs .nav-link:hover::before,
.tabs_btn .nav-tabs .nav-link.active::before {
  left: 0;
}

.tabs_btn .nav-tabs .nav-link:hover,
.tabs_btn .nav-tabs .nav-link.active {
  color: white;
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
}

.tab_img {
  width: 100%;
  border-radius: 8px;
}

.tab_h3 {
  font-size: 24px;
  font-weight: bold;
  color: #333;
  margin-bottom: 20px;
}

.tab_p {
  color: #666;
  line-height: 1.8;
  margin-bottom: 20px;
  text-align: justify;
}

.tab_more {
  background: var(--primary-color);
  color: white;
  padding: 12px 30px;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 600;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-light);
  position: relative;
  overflow: hidden;
}

.tab_more::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transition: all var(--transition-normal);
  transform: translate(-50%, -50%);
}

.tab_more:hover::before {
  width: 300px;
  height: 300px;
}

.tab_more:hover {
  background: var(--primary-hover);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-heavy);
}

/* 分类导航样式优化 */
.center_nav_ul {
  list-style: none;
  padding: 0;
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.center_nav_ul li {
  position: relative;
}

.center_nav_ul li a {
  display: block;
  padding: 12px 25px;
  background: white;
  border: 2px solid var(--primary-color);
  border-radius: 25px;
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-light);
}

.center_nav_ul li a::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: var(--primary-color);
  border-radius: 50%;
  transition: all var(--transition-normal);
  transform: translate(-50%, -50%);
  z-index: -1;
}

.center_nav_ul li a:hover::before {
  width: 200%;
  height: 200%;
}

.center_nav_ul li a:hover {
  color: white;
  transform: translateY(-3px);
  box-shadow: var(--shadow-heavy);
}

.center_nav_ul li a.active {
  background: var(--primary-color);
  color: white;
  box-shadow: var(--shadow-medium);
}

/* 页脚样式 */
.footer_nav {
  background: rgba(255, 255, 255, 0.95);
  border-top: 1px solid #ddd;
}

.foot_nav {
  flex: 1;
  text-align: center;
  padding: 10px 5px;
}

.foot_nav a {
  color: #666;
  text-decoration: none;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.foot_nav a .glyphicon {
  font-size: 18px;
  margin-bottom: 5px;
}

/* 全局页面间距调整 - 为固定导航栏留出空间 */
body {
  padding-top: 110px; /* 为顶部欢迎条(44px) + 固定导航栏(66px)留出空间 */
}

/* 首页特殊处理 */
.home-page {
  padding-top: 0 !important;
}

/* 轮播图在首页的特殊处理 */
.home-page .hero-carousel {
  margin-top: 0;
}

/* 响应式调整优化 */
@media (max-width: 768px) {
  body {
    padding-top: 66px; /* 移动端只有导航栏高度 */
  }

  .main-navbar {
    top: 0 !important; /* 移动端导航栏贴顶 */
    width: 100%;
    margin: 0;
    border-radius: 0;
    z-index: 1050; /* 确保移动端导航栏层级最高 */
  }

  .hero-carousel {
    margin-top: -66px; /* 调整为移动端导航栏高度 */
  }

  .process_col {
    margin-bottom: 20px;
  }

  .center_nav_ul {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  .center_nav_ul li {
    margin: 5px 0;
    width: 80%;
  }

  .center_nav_ul li a {
    width: 100%;
    text-align: center;
  }

  /* 移动端卡片优化 */
  .product_img,
  .news_img {
    margin-bottom: 20px;
  }

  .product_img:hover,
  .news_img:hover {
    transform: none; /* 移动端禁用悬浮效果 */
  }

  .product_img:hover img,
  .news_img:hover img {
    transform: scale(1.02); /* 减少缩放效果 */
  }

  /* 移动端按钮优化 */
  .btn {
    font-size: 16px; /* 增大移动端按钮字体 */
    padding: 12px 20px;
  }

  .tab_more {
    padding: 15px 30px;
    font-size: 16px;
  }
}

/* 通用卡片样式 */
.card {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-light);
  transition: all var(--transition-normal);
  overflow: hidden;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-medium);
}

/* 通用加载动画 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* 页面进入动画 */
.page-enter-active {
  animation: fadeIn 0.5s ease-out;
}

.fade-enter-active,
.fade-leave-active {
  transition: opacity var(--transition-normal);
}

.fade-enter,
.fade-leave-to {
  opacity: 0;
}

/* 通用文本样式 */
.text-primary {
  color: var(--primary-color) !important;
}

.text-muted {
  color: var(--text-muted) !important;
}

/* 通用间距 */
.section-padding {
  padding: 60px 0;
}

.section-margin {
  margin: 60px 0;
}

/* 客服面板样式优化 */
.customer-service-panel {
  z-index: 9999;
}

.service-btn {
  box-shadow: var(--shadow-light);
  transition: all var(--transition-normal);
}

.service-btn:hover {
  box-shadow: var(--shadow-heavy);
  transform: translateY(-2px);
}

.service-panel,
.qrcode-panel {
  z-index: 10000;
}
